home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.app;
-
- import com.extensibility.plugin.api.ResLocationPlugin;
- import com.extensibility.plugin.api.ResLocationPluginPanel;
- import com.extensibility.plugin.api.URIScheme;
- import com.extensibility.rock.RAction;
- import com.extensibility.xml.URI;
- import java.awt.Container;
- import java.awt.Frame;
- import java.awt.Window;
- import java.io.File;
- import javax.swing.AbstractButton;
- import javax.swing.Box;
- import javax.swing.JButton;
-
- public class OpenURIDialog extends SaveURIDialog {
- RAction newAction = new 1(this);
- public boolean isNewURI = false;
- String[] myOpenTypes = null;
- private boolean showNew = false;
-
- public OpenURIDialog(Frame var1, URI var2, String[] var3) {
- super(var1, var2);
- this.myOpenTypes = var3;
- }
-
- public OpenURIDialog(Frame var1, URI var2, String[] var3, String var4) {
- super(var1, var2, var4);
- this.myOpenTypes = var3;
- }
-
- public OpenURIDialog(Frame var1, URI var2, String[] var3, boolean var4) {
- super(var1, var2);
- this.myOpenTypes = var3;
- this.showNew = var4;
- }
-
- public OpenURIDialog(Frame var1, URI var2, String[] var3, String var4, boolean var5) {
- super(var1, var2, var4);
- this.myOpenTypes = var3;
- this.showNew = var5;
- }
-
- protected void fillButtonBox(Box var1) {
- if (this.showNew) {
- ((Container)var1).add(Box.createHorizontalStrut(8));
- JButton var2 = new JButton(UI.getString("dialog.new"));
- ((AbstractButton)var2).addActionListener(this.newAction);
- ((AbstractButton)var2).setMnemonic(UI.getMnemonic("dialog.new"));
- ((Container)var1).add(var2);
- }
-
- super.fillButtonBox(var1);
- }
-
- public boolean isNew() {
- return this.isNewURI;
- }
-
- protected void prepare() {
- super.prepared = true;
- super.bSaving = false;
- if (super.title == null) {
- super.title = UI.getString("dialog.open.uri.title");
- }
-
- super.prepare();
- }
-
- protected boolean pluginIsAppropriate(ResLocationPlugin var1) {
- return var1.canOpen((String)null);
- }
-
- protected ResLocationPluginPanel getPluginPanel(ResLocationPlugin var1) {
- return var1.getOpenPanel(this);
- }
-
- public void okSave(URIScheme var1) {
- }
-
- public void okOpen(URIScheme var1) {
- super.uri = new URI(var1);
- ((Window)this).dispose();
- }
-
- public File askFile(String var1, String[] var2) {
- return var2 == null ? super.askFile(var1, this.myOpenTypes) : super.askFile(var1, var2);
- }
-
- protected void doNew() {
- SaveURIDialog var1 = new SaveURIDialog(Desktop.getDialogParent(this), super.baseURI);
- var1.show();
- URI var2 = var1.getURI();
- if (var2 != null) {
- super.uri = var2;
- this.isNewURI = true;
- ((Window)this).dispose();
- }
-
- }
- }
-